/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package library.impl;

import java.util.Collection;

import library.LibraryPackage;
import library.RentRecord;
import library.RentRecords;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc --> An implementation of the model object '<em><b>Rent Records</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 * <li>{@link library.impl.RentRecordsImpl#getRentRecords <em>Rent Records</em>}</li>
 * </ul>
 * </p>
 * 
 * @generated
 */
public class RentRecordsImpl extends EObjectImpl implements RentRecords {
	/**
	 * The cached value of the '{@link #getRentRecords() <em>Rent Records</em>}'
	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @see #getRentRecords()
	 * @generated
	 * @ordered
	 */
	protected EList<RentRecord> rentRecords;

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	protected RentRecordsImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */

	protected EClass eStaticClass() {
		return LibraryPackage.Literals.RENT_RECORDS;
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	public EList<RentRecord> getRentRecords() {
		if (rentRecords == null) {
			rentRecords = new EObjectContainmentEList<RentRecord>(
					RentRecord.class, this,
					LibraryPackage.RENT_RECORDS__RENT_RECORDS);
		}
		return rentRecords;
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */

	public NotificationChain eInverseRemove(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
		case LibraryPackage.RENT_RECORDS__RENT_RECORDS:
			return ((InternalEList<?>) getRentRecords()).basicRemove(otherEnd,
					msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */

	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case LibraryPackage.RENT_RECORDS__RENT_RECORDS:
			return getRentRecords();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case LibraryPackage.RENT_RECORDS__RENT_RECORDS:
			getRentRecords().clear();
			getRentRecords()
					.addAll((Collection<? extends RentRecord>) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */

	public void eUnset(int featureID) {
		switch (featureID) {
		case LibraryPackage.RENT_RECORDS__RENT_RECORDS:
			getRentRecords().clear();
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */

	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case LibraryPackage.RENT_RECORDS__RENT_RECORDS:
			return rentRecords != null && !rentRecords.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} // RentRecordsImpl
